package org.dtp;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @author Bestlee
 * @description: 此类主要用于容器初始化后将线程池放入map中
 * @Version 1.0
 */
/*实现BeanPostProcessor 可参考 https://www.cnblogs.com/tuyang1129/p/12866484.html*/
public class DtpBeanPostProcessor  implements BeanPostProcessor {
    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if(bean instanceof DtpExecutor){
            DtpUtil.put(beanName,(DtpExecutor) bean);
        }
        return bean;
    }
}
